package com.nowcoder.community.service;

import com.nowcoder.community.entity.LoginTicket;
import com.nowcoder.community.entity.User;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.Map;

/**
* @author mutou
* @description 针对表【user】的数据库操作Service
* @createDate 2024-07-13 23:48:58
*/
public interface UserService {
    User findUserById(Integer id);

    Map<String, Object> register(User user);

    Integer activation(Integer userId, String code);

    Map<String, Object> login(String username, String password, Integer expiredSecond);

    void logout(String ticket);

    LoginTicket findLoginTicket(String ticket);

    Integer updateHeader(Integer userId, String headerUrl);

    String updatePassword(Integer userId, String oldPassword, String newPassword);

    User findUserByName(String username);

    Collection<? extends GrantedAuthority> getAuthorities(int userId);
}
